cmake_minimum_required(VERSION 2.8)

project(rpmcpp)

set(CMAKE_CXX_FLAGS_DEBUG "-g3 -Wall -g -ggdb -fPIC")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -fPIC")
set(CMAKE_CXX_STANDARD 11)
set(LIB_VERSION 1.0.0)

set(CMAKE_C_FLAGS "-static-libgcc")
set(CMAKE_SKIP_RPATH FALSE)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "." "/usr/local/sniper/lib")

include_directories(/usr/local/include)

include_directories(.)

aux_source_directory(. SRC_LIST)

link_directories(/usr/local/lib)

add_library(${PROJECT_NAME} SHARED ${SRC_LIST})

SET(LIBRARY_OUTPUT_PATH lib)

SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${LIB_VERSION})

target_link_libraries(${PROJECT_NAME} rpm)
target_link_libraries(${PROJECT_NAME} rpmio)

install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)

